package userinterface;

import java.awt.Label;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JTextField;

import alList.StuGPA;
import db.DBquery;
import excel.FormExport;

public class QueryInfo extends BasicUI {

	private static final long serialVersionUID = 10L;
	static String id;
	static JButton preview, export;
	static JTextField textField, exportFile;
	DBquery dBquery = new DBquery();
	static JButton queryButton;
	Label label;
	
	public QueryInfo(String string1, String string2) {
		super();
		
		label = new Label(string1);
		container.add(label);
		label.setBounds(200, 0, 100, 50);
		
		Label label2 = new Label(string2);
		container.add(label2);
		label2.setBounds(200, 50, 300, 30);

		textField = new JTextField();
		container.add(textField);
		textField.setBounds(200, 80, 190, 30);

		preview = new JButton("preview");
		container.add(preview);
		preview.setBounds(450, 80, 100, 30);
		
		Label label3 = new Label("Please input the Excel path you want to export into:");
		container.add(label3);
		label3.setBounds(200, 130, 400, 30);

		exportFile = new JTextField();
		container.add(exportFile);
		exportFile.setBounds(200, 160, 240, 30);
		
		export = new JButton("export");
		container.add(export);
		export.setBounds(450, 160, 100, 30);
		
	}
	
	public void export(String fileString, List<StuGPA> stuGPAs) throws Exception {
		FormExport.exportList(fileString, stuGPAs);
	}

}
